function mock({
	url,
	data,
	method = "GET",
	contentType = 1
}) {
	let baseUrl = "https://dev.usemock.com/65337d72645c3447abd52a14";
	let header = {
		"content-type": contentType == 1 ? "application/json" : "application/x-www-form-urlencoded"
	};
	return new Promise((resolve, reject) => {
		uni.request({
			url: baseUrl + url,
			data,
			header,
			method,
			success: (res) => {
				if (res.statusCode == 200) {
					resolve(res)
				} else {
					uni.showToast({
						title: '请求失败' + res.statusCode,
						icon: "none",
						duration: 1500
					});
				}
			},
			fail: (err) => {
				console.log(err.errMsg);
				uni.showToast({
					title: "fail",
					icon: none,
					duration: 1500
				});
				reject(err)
			}
		})
	})
}

export default {
	mock
}